package com.ruoyi.framework.youshuda.cleanup;

import io.netty.buffer.PooledByteBufAllocator;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.stereotype.Component;

/**
 * 应用关闭时，处理 Netty 资源
 */
@Component
public class NettyResourceCleanup implements DisposableBean {

    @Override
    public void destroy() {
        PooledByteBufAllocator.DEFAULT.buffer().release(); // 释放 Netty 的缓冲区
    }
}
